package com.eascs.spider.ant.worker.spider;

import org.apache.http.impl.client.CloseableHttpClient;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.eascs.spider.ant.common.util.NetUtil;
import com.eascs.spider.ant.worker.manager.TaskManager;
import com.eascs.spider.ant.worker.util.MongoSession;

/**
 * 一个简单的爬虫
 * @author hzp
 *
 */
public abstract class SimpleSpider implements Runnable{

	protected static Logger logger = LoggerFactory.getLogger(SimpleSpider.class);
	
	protected String url ;
	
	protected CloseableHttpClient client = NetUtil.initHttpClient();
	
	protected TaskManager manager;
	
	protected MongoSession mongoSession;
	
	public SimpleSpider(String url){
		this.url = url;
		this.manager = TaskManager.getInstance();
		this.mongoSession = MongoSession.getInstance();
	}
	
	@Override
	public abstract void run();
}
